import request from "@/utils/request"
import axios from 'axios'

const baseUrl = '/dataManage/data'

// 图层查询
export function getGeom(data) {
  return request({
    url: `${baseUrl}/getGeom`,
    method: 'post',
    data
  })
}

// 地震速报
export function getRapid() {
  return request({
    url: `/manage/earthQuake/quickReport`,
    method: 'get'
  })
}

// 系统消息
export function getRemind(type) {
  return request({
    url: `/manage/earthQuake/getData/${type}`,
    method: 'get'
  })
}

// 根据经纬度获取省市区
// longitude，latitude
export function getLocationBylatAndLon(params) {
  return request({
    url: `/manage/drawing/getLocationBylatAndLon`,
    method: 'get',
    params
  })
}
// 制图预览图片
// 1地震构造图  0断层分布图
export function getImgUrl(type) {
  return request({
    url: `/manage/drawing/drawing/${type}`,
    method: 'get'
  })
}

// 确定出图
export function saveMap(data, cancel) {
  return request({
    url: `/manage/drawing/save`,
    method: 'post',
    data,
    cancelToken: new axios.CancelToken(function executor(c) {
      cancel.c = c;
    })
  })
}

// 获取模板
export function getTemplate(type) {
  return request({
    url: `/manage/map/getList/${type}`,
    method: 'get'
  })
}